using System;
using System.Collections.Generic;
using NHibernate;
using SinBiota.Model.Entities;
using SinBiota.Model.Persistence.Repositories.Interfaces;

namespace SinBiota.Model.Persistence.Repositories.Implementation
{
    public class EcosystemRepository : RepositoryAbstract<Ecosystem,int>, IEcosystemRepository
    {
        public EcosystemRepository(ISession session) : base(session)
        {
        }

        public Ecosystem FindByName(string name)
        {
            return FindByEqRestrictionUniqueResult(x => x.Name, name);
        }

        public IList<Ecosystem> FindByNameLike(string name)
        {
            return FindByInffix(x => x.Name, name);
        }
    }
}